from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
import time

#下拉框处理

driver = webdriver.Edge()

url = "https://www.baidu.com/"

driver.get(url)
# select下拉框元素定位
select = Select(driver.find_element())
# 根据索引选择
select.select_by_index()
# 根据值选择
select.select_by_value()
# 根据可见文本选择
select.select_by_visible_text()

    
time.sleep(5)
driver.quit()